package acwing._1_1AlgorithmBasic._3SearchGraph;

/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._1_1AlgorithmBasic._3SearchGraph
 * @File : Q0848.java
 * @Author : WangRuoyu
 * @Date : 2023/4/2 10:39
 */

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;

public class Q0848 {
    static int n;
    static int m;
    static int[] h;
    static int[] e;
    static int[] next;
    static int[] degree;
    static int idx;

    static void add(int a, int b) {
        e[idx] = b;
        next[idx] = h[a];
        h[a] = idx++;
    }

    static boolean topsort(ArrayList<Integer> res) {
        Queue<Integer> q = new LinkedList<>();

        for (int i = 1; i <= n; ++i) {
            if (degree[i] == 0) {
                q.add(i);
                degree[i] = -1;
            }
        }

        while (!q.isEmpty()) {
            int p = q.poll();
            res.add(p);
            for (int i = h[p]; i != -1; i = next[i]) {
                int j = e[i];
                degree[j]--;
                if (degree[j] == 0) {
                    q.add(j);
                    degree[j] = -1;
                }
            }
        }

        return res.size() == n;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String[] words = br.readLine().split(" ");
        n = Integer.parseInt(words[0]);
        m = Integer.parseInt(words[1]);
        h = new int[n + 1];
        degree = new int[n + 1];
        e = new int[m + 10];
        next = new int[m + 10];
        Arrays.fill(h, -1);
        degree[0] = -1;

        for (int i = 0; i < m; ++i) {
            words = br.readLine().split(" ");
            int a = Integer.parseInt(words[0]);
            int b = Integer.parseInt(words[1]);
            add(a, b);
            degree[b]++;
        }

        ArrayList<Integer> res = new ArrayList<>();

        if (!topsort(res)) {
            System.out.println(-1);
        } else {
            for (Integer re : res) {
                System.out.print(re + " ");
            }
        }
    }
}
